import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
Vue.use(VueRouter)

const routes: RouteConfig[] = [
  {
    name: 'Index',
    path: '/',
    component: () => import('../views/Index.vue')
  }
]

const router = new VueRouter({
  mode: 'hash'
})

function addToVueRouter () {
  routes.forEach((route: RouteConfig) => {
    router.addRoute(route)
  })
}
addToVueRouter()

export default router
